package cn.com.sbell.vss;

import java.util.HashSet;
import java.util.Locale;
import java.util.Set;

public class VssConstants {

	public final static String TRANSACTION_ID = "X-Transaction-ID";

	public final static String CLIENT_ADDRESS = "X-Client-Address";

	public final static String SESSION_ID = "sessionId";

	public final static String PATTERN_TIMESTAMP = "yyyy-MM-dd HH:mm:ss";

	public final static String DEFAULT_TIMEZONE = "GMT+8";

	public final static Locale DEFAULT_LOCALE = Locale.CHINA;

	public final static String DEFAULT_ENCODINIG = "UTF-8";

	public final static String DATABASE_CHARSET = "UTF-8";

	public final static int DEFAULT_SESSION_TIMEOUT = 600; // second

	public final static String ROOT_AREA_ID = "<ROOT>";

	public final static String ALL_PERMISSION = ".*";

	public final static String ROLE_NAME_SYSADMIN = "sysadmin";

	public final static String ROOT_USERNAME = "root";

	public final static String KEY_USER_SESSION_DATA = "KEY_USER_SESSION_DATA";

	public final static String KEY_COMMAND = "KEY_COMMAND";

	public final static String KEY_TARGET_DOMAIN_ID = "KEY_TARGET_DOMAIN_ID";

	// public final static String KEY_LOCAL_DOMAIN_ID = "KEY_LOCAL_DOMAIN_ID";

	public final static String KEY_VSS_LOG = "KEY_VSS_LOG";

	public final static String KEY_VSS_LICENSE = "KEY_VSS_LICENSE";

	public final static int KEY_NONRESTRICTIVE = -1;

	public final static String KEY_VSS_HOST_ID = "KEY_VSS_HOST_ID";

	// public final static String KEY_NEIGHBOR_DOMAIN = "3";

	public final static String KEY_RETURN_COD = "resultCode";

	public final static String KEY_RETURN_MSSAGE = "result";

	public final static String KEY_IGNORE_ITEMS = "ignoreItems";

	public final static String KEY_ADDED_ITEMS = "addedItems";

	public final static String KEY_SENDREQUEST_RESULT = "resultCode";

	public final static String FRONT_TYPE_AH="AH";
	
	public final static String FRONT_TYPE_VS="VS";
	
	public final static String FRONT_TYPE_IPCAM="IPCAM";
	
	public final static String 	KEY_FRONT_TYPE="frontType";
	
	public final static String VENDOR="vsVendor";
	
	// data type
	// 0 string 1 int 2 long 3 double 4 date
	public final static int DATA_STRING = 0;

	public final static int DATA_INTEGER = 1;

	public final static int DATA_LONG = 2;

	public final static int DATA_DOUBLE = 3;

	public final static int DATA_DATE = 4;

	public final static int SEVERITY_CRITICAL = 100;

	public final static int SEVERITY_MAJOR = 50;

	public final static int SEVERITY_MINOR = 10;

	public final static int SEVERITY_INFO = 0;

	public final static int AREAID_LENGTH = 3;

	//
	// // default date patterns
	// public final static String[] DATE_PATTERNS = { "yyyy.MM.dd HH:mm:ss",
	// "yyyy-MM-dd HH:mm:ss", "yyyy MM dd HH:mm:ss", "yyyyMMddHH:mm:ss" };

	// storage TASK Status from 0-6, ERROR - CACELED
	public final static int TASK_STATUS_ERROR = 0;
	public final static int TASK_STATUS_ACCEPTED = 1;
	public final static int TASK_STATUS_EXECUTING = 2;
	public final static int TASK_STATUS_FILE_CREATED = 3;
	public final static int TASK_STATUS_PARTIAL_COMPLETED = 4;
	public final static int TASK_STATUS_ALL_COMPLETED = 5;
	public final static int TASK_STATUS_CACELED = 6;
	public final static int TASK_STATUS_PAUSED = 7;

	public static final char ACTION_INSERT = 'C';

	public static final char ACTION_DELETE = 'D';

	public static final char ACTION_QUERY = 'R';

	public static final char ACTION_UPDATE = 'U';

	// CSG MATCHED CODE STATUS
	public static final String RESULT_NORMAL_STATUS = "0";

	public static final String RESULT_FORMAT_STATUS = "1";

	public static final String WEB_PAGE_STATUS = "2";

	public static final String RESULT_UNSUPPORTED_MODELS_STATUS = "4";

	public static final String MODEL_TYPE = "BL-C30";

	public static final String MODEL_10TYPE = "BL-C10";

	public static final String MODEL_381TYPE = "BB-HCM381";

	public static final int NORMAL_STATUS_CODE = 200;

	public static final String METHOD_NAME = "/nphManipulateCamera";

	public static final String METHOD_PARAMETER = "PAGE";

	public static final String PRODUCT_VERSION_KX = "KX";

	public static final int PTZ_MAX_NUMBER = 8;

	// result code
	public static final String CODE_SUCCESS = "0";

	public static final String CODE_PARAMETER_ERROR = "1";

	public static final String CODE_DATABASE_ACCESS_ERROR = "2";

	public static final String CODE_UNSUPPORTED_COMMAND_ERROR = "3";

	public static final String CODE_NO_PERMISSION_ERROR = "4";

	public static final String CODE_INVALID = "5";

	public static final String CODE_MAXLENGTH = "6";

	public static final String CODE_MINLENGTH = "7";

	public static final String CODE_RANGE = "8";

	public static final String CODE_REQUIRED = "9";

	public static final String CODE_BYTE = "10";

	public static final String CODE_DATE = "11";

	public static final String CODE_DOUBLE = "12";

	public static final String CODE_FLOAT = "13";

	public static final String CODE_INTEGER = "14";

	public static final String CODE_LONG = "15";

	public static final String CODE_SHORT = "16";

	public static final String CODE_CREDITCARD = "17";

	public static final String CODE_EMAIL = "18";

	public static final String CODE_NOT_EXISTS = "19";

	public static final String CODE_UNIQUE = "20";

	public static final String CODE_AUTHENTICATION_FAILED = "21";

	public static final String CODE_NEED_LOGIN = "22";

	public static final String CODE_NO_MATCHED_RECORD = "23";

	public static final String CODE_INVALID_LICENSE = "24";

	public static final String CODE_CAMERA_AMOUNT_EXCEED = "25";

	public static final String CODE_USER_AMOUNT_EXCEED = "26";

	public static final String CODE_IN_USING = "27";

	public static final String CODE_CANNOT_BE_DELETE = "28";

	public static final String CODE_XML_INVALID = "29";

	public static final String CODE_CANNOT_GET_JDBC_CONNECTION = "30";

	public static final String CODE_USER_DISABLED = "31";

	public static final String CODE_IPADDRESS_INVALID = "32";

	public static final String CODE_OVER_ORGANIZATION_MAXUSER = "33";

	public static final String CODE_ORGANIZATION_MAXUSERS_UPDATE = "34";

	public static final String CODE_EQUIPMENT_DISABLED = "35";
	
	public static final String CODE_SENDING_CSG_FAILED = "36";

	public static final String CODE_A_LESSTHAN_B = "40";

	public static final String CODE_A_GREATERTHAN_B = "41";

	public static final String CODE_CANNOT_USE_THIS_USERNAME_LOGIN = "42";

	public static final String CODE_GETDEVICEID_FAIL="43";
	
	public static final String CODE_GETVSCOMMON_INFO_FIAL="44";
	
	public static final String CODE_UNKNOWN_ERROR = "99";

//result code for interdomain routing	
	public static final String CODE_RELAY_ERROR="4000";
	
	public static final String CODE_INVALIDE_ROUTE="4001";
	
	public static final String CODE_NEXTDOMAIN_AUTHENTICATE_FIAL="4002";
	
	public static final String CODE_GETVSINFO_FAILED = "4003";
	
	public static final String CODE_MS_SETDEVICEID_FAILED="4004";
	
	public static final String CODE_GET_ALARM_FAILED="4005";
	
	public static final String CODE_SET_AH_DEFENCE_FAILED="4006";
	
	public static final String CODE_GET_AH_DEFENCE_FAILED="4007";
	
	public static final String CODE_GET_VS_PPPOE_PERIOD_FAILED="4008";
	
	public static final String CODE_SET_VS_PPPOE_PERIOD_FAILED="4009";
	
	public static final String 	CODE_SET_VS_PRINT_LOG_FAILED="4010";
	
	public static final String CODE_RECORD_VIDEO_FAILED="4011";
	
	public static final String CODE_VS_SET_PTZREGRESS_FAILED="4012";
	
	public static final String CODE_VS_GET_PTZREGRESS_FAILED="4013";
	
	public static final String CODE_VS_SET_UPLOAD_PICTURE="4111";
	
	public static final String CODE_VS_GET_UPLOAD_PICTURE="4112";
	
	// Exception code from gpio
	public static final String CODE_GPIO_INVALID = "100";

	public static final String CODE_DELETE_AREA_WITH_SUBITEM_ERROR = "101";

	public static final String CODE_CANNOT_DELETE_ROOT_AREA = "102";

	public static final String CODE_NEED_STOP_ALL_TASK_BEFORE_DELETE_SA = "105";

	public static final String CODE_NOT_APPOINT_AREA = "106";

	public static final String CODE_VS_CAMERANUMBER_UNIQUE = "107";

	public static final String CODE_ID_EXCEED = "108";

	public static final String CODE_USERS_EXIST_ORGANIZATION = "109";

	public static final String CODE_AUDIO_INVALID = "110";

	public static final String CODE_VIDEOQUALITY_QUERY = "114";

	public static final String CODE_AREA_NAME_UNIQUE = "115";

	public static final String CODE_PERMISSION_FORMAT = "120";

	public static final String CODE_USERNUMBER_RANGE = "121";

	public static final String CODE_USERNUMBER_DISTRIBUTED = "122";

	public static final String CODE_USERNUMBER_RANGE_MODIFY_ERROR = "123";

	public static final String CODE_CANNOT_DELETE_ORGANIZATION_ADMINUSER = "111";

	public static final String CODE_PAIR_PARAMS_NOT_EQUALS = "200";

	public static final String CODE_SERVER_EERORS = "201";

	public static final String CODE_NOT_THE_SAME = "202";

	public static final String CODE_CAMEREA_IN_OTHER_GROUPS = "203";

	public static final String CODE_NEED_BACKUP_BEFORE_CLEAN = "204";

	public static final String CODE_TASK_HAS_BEEN_CANCELED = "205";

	public static final String CODE_TIME_OUT_RANGE = "206";

	public static final String CODE_START_TIME_LARGER = "207";

	public static final String CODE_SERVER_RETURN_ERROR = "208";

	public static final String CODE_TIME_OVER_MIN_MAX_RANGE = "209";

	public static final String CODE_TASK_HAS_BEEN_PAUSED = "210";

	public static final String CODE_TASK_STATUS_HINT = "211";

	public static final String CODE_DISK_FULL = "212";

	public static final String CODE_NO_PRIVILEGE_WRITE = "213";

	public static final String CODE_FILE_IO_ERROR = "214";

	public static final String CODE_AREA_ORG_ID_NULL_ERROR = "215";

	public static final String CODE_DOMAIN_IDNAME_NULL_ERROR = "216";

	public static final String CODE_DOMAIN_TRGTID_OWNSUPER_ERROR = "217";

	public static final String CODE_DOMAIN_REMOTE_ACCESS_ERROR = "218";

	public static final String CODE_DOMAIN_REMOTE_RETURN = "219";

	public static final String CODE_DOMAIN_TYPE_ERROR = "220";

	public static final String CODE_DOMAIN_TYPE_ACCESS_ERROR = "221";

	public static final String CODE_DOMAIN_THIS_CANT_DEL = "222";

	public static final String CODE_DOMAIN_THIS_EXIST = "223";

	public static final String CODE_SA_DELETE_EXIST_TASK_ERROR = "224";

	public static final String CODE_UNIQUE_IP_PORT = "280";

	public static final int CODE_DOMAIN_TYPE_THIS = 1;

	public static final int CODE_DOMAIN_TYPE_SUPERIOR = 2;

	public static final int CODE_DOMAIN_TYPE_NEIGHBOR = 3;

	public static final int CODE_DOMAIN_CONN_NOT = 0;

	public static final int CODE_DOMAIN_CONN_ING = 1;

	public static final int CODE_DOMAIN_CONNECTED = 2;

	public static final int CODE_DOMAIN_CONN_ERROR = 3;

	// Exception Code from CSG
	public static final String CODE_CONTROLPTZ_FAILED = "300";

	public static final String CODE_CONTROLPTZ_COMPETE_FAILED = "3000";

	public static final String CODE_DELETEVSUSER_FAILED = "301";

	public static final String CODE_SETVSIMAGEADJUSTING_FAILED = "302";

	public static final String CODE_GETVSIMAGEADJUSTING_FAILED = "3020";

	public static final String CODE_SETVSIMAGEFORMAT_FAILED = "303";

	public static final String CODE_GETVSIMAGEFORMAT_FAILED = "3030";

	public static final String CODE_SETVSSERIALPORT_FAILED = "304";

	public static final String CODE_GETVSSERIALPORT_FAILED = "3040";

	public static final String CODE_SETVSUSER_FAILED = "305";

	public static final String CODE_GETVSUSER_FAILED = "3050";

	public static final String CODE_SETVSVIDEO_FAILED = "306";

	public static final String CODE_GETVSVIDEO_FAILED = "3060";

	public static final String CODE_SUBSCRIBEALARM_FAILED = "307";

	public static final String CODE_VISIT_NVS_ERROR = "308";

	public static final String CODE_UNSUPPORTED_PTZ_PROTOCOL = "309";

	public static final String CODE_UNSUPPORTED_PTZ_PROTOCOL_COMMAND = "310";

	public static final String CODE_UNSUPPORTED_ACTION = "311";

	public static final String CODE_SETVSIMGPARAM_FAILED = "312";

	public static final String CODE_GETVSIMGPARAM_FAILED = "3120";

	public static final String CODE_VS_AUTHENTICATE_FAILED = "313";

	public static final String CODE_SETVSIPINFO_FAILED = "314";

	public static final String CODE_GETVSIPINFO_FAILED = "3140";

	public static final String CODE_SETGPIODEVICE_FAILED = "315";

	public static final String CODE_GETGPIODEVICE_FAILED = "3150";

	public static final String CODE_SETVSTIME_FAILED = "316";

	public static final String CODE_GETVSTIME_FAILED = "3160";

	public static final String CODE_UNSUPPORT_VS_VENDOR = "317";

	public static final String CODE_SETDECODER_FAILED = "318";

	public static final String CODE_GETDECODER_FAILED = "3180";

	public static final String CODE_CONTROLVS_FAILED = "319";

	public static final String CODE_SET_VS_LOCAL_STORAGE_TASK_FAILED = "320";

	public static final String CODE_GET_VS_LOCAL_STORAGE_TASK_FAILED = "3200";

	public static final String CODE_STOP_VS_LOCAL_STORAGE_TASK_FAILED = "321";

	public static final String CODE_SET_PRESET_FAILED = "322";

	public static final String CODE_GET_PRESET_FAILED = "3220";

	public static final String CODE_UNSUPPORTED_EQUIPMENT_COMMAND = "323";

	public static final String CODE_SET_NTP_FAILED = "324";

	public static final String CODE_SET_IPCAMERAINFO_FAILED = "325";

	public static final String CODE_SET_IPCAMERA_MOTION_DETECT_FAILED = "326";

	public static final String CODE_VS_RETURN_ERROR_RESULT = "327";

	public static final String CODE_VS_GETDISKINFO_FAILED = "328";

	public static final String CODE_VS_GETLOCALSTORAGEFILE_FAILED = "329";

	public static final String CODE_VS_GETSOFTVERSION_FAILED = "3290";

	public static final String CODE_VS_GETDEVICEWORKSTATE_FAILED = "3291";

	public static final String CODE_VS_SETDEVICEID_FAILED = "330";

	public static final String CODE_VS_SETCRUISETRACK_FAILED = "331";

	public static final String CODE_VS_GETCRUISETRACK_FAILED = "332";
	public static final String CODE_TRANSPARENTCHANNEL_FAILED = "333";

	public static final String CODE_SET_HIDE_IMAGE_AREA_FAILED = "334";
	public static final String CODE_GET_HIDE_IMAGE_AREA_FAILED = "3340";
	
	public static final String CODE_SET_VS_COMMON_FAILED="335";
	
	public static final String CODE_VS_SETNETMANAGEINFO_FAILED = "336";
	public static final String CODE_VS_GETNETMANAGEINFO_FAILED = "3360";
	
	public static final String CODE_VS_GETVSPERFORMANCE_FAILED = "337";
	
	public static final String CODE_VS_GET_COMMAND_FAILED = "3999";
	
	public static final int SERVER_NOT_SUPPORT=23;
	
	public static final int SERVER_DATA_ERROR=11;
	
	// Exception Code from MA
	public static final String CODE_MS_ERROR = "600";

	public static final String SOURCE_TYPE_EMS = "EMS";

	public static final String SOURCE_TYPE_CSG = "CSG";

	public static final String SOURCE_TYPE_SMG = "SMG";

	public static final String SOURCE_TYPE_SA = "SA";

	public static final String SOURCE_TYPE_MA = "MA";

	public static final String SOURCE_TYPE_VS = "VS";

	public static final String SOURCE_TYPE_NVS = "NVS";

	public static final String SOURCE_TYPE_MS = "MS";

	public static final String SOURCE_TYPE_CAM = "CAM";

	// result of vedio server upgrade
	public static final String VS_UPGRADE = "VS_UPGRADE"; // alarm type

	public static final int VS_UPGRADE_SUCCESS = 0;

	public static final int VS_UPGRADE_NOMATCH_VERSION = 1; // language version

	// of updated files
	// is not match

	public static final int VS_UPGRADE_OVERTIME = 2; // overtime

	public static final int VS_UPGRADE_NOTGETFILE = 3; // get updated files

	// unsuccessfully

	public static final int VS_UPGRADE_UNKNOWN = 4; // UNKNOWN

	public static final String BAKUP_TABLE_COMMAND_KEY = "backupCommand";

	public static final String MAITAIN_TASK_INIT = "INIT";

	public static final String MAITAIN_TASK_WAITTING = "WAITTING";

	public static final String MAITAIN_TASK_RUNNING = "RUNNING";

	public static final String MAITAIN_TASK_STOPPED = "STOPPED";

	public static final String RECORD_TYPE_ON_TIME = "0";

	public static final String RECORD_TYPE_ON_MOTIONDETECT = "1";

	public static final String RECORD_TYPE_ON_GPIN = "2";

	public static final String ALARM_TYPE_CAM_MOTIONDETECT = "CAM_MOTIONDETECT";

	public static final String ALARM_TYPE_VS_GPIN = "VS_GPIN";

	public static final String ALARM_TYPE_ORG_DISKFULL = "ORG_DISKFULL";

	// true and false

	public static final String CONSTANTS_TRUE = "true";

	public static final String CONSTANTS_FALSE = "false";

	public static final String CONSTANTS_EDIT_ONLINE = "Y";

	// alarm status
	public static final int ALARM_STATUS_ALARMING = 0;

	public static final int ALARM_STATUS_ELIMINATED = 1;

	public static final int ALARM_STATUS_PROCESSING = 2;

	// executeMode
	public static final String TASK_EXECUTEMODEL_CYCLE = "0";

	public static final String TASK_EXECUTEMODEL_IMMEDIATE = "1";

	public final static String CODE_TASK_ID_EXISTED = "700";

	// telecom
	public static final String USER_TELECOM = "TELECOM";

	public static final int USER_MAX_LEVEL = 1;

	// requestForwarder attribute
	public static final String KEY_RESULT_TYPE = "resultType";

	public static final String CODE_RESULT_TYPE_MAP = "1";

	public static final String CODE_RESULT_TYPE_STR = "2";

	public static final String CODE_RESULT_TYPE_OBJ = "3";

	// SYSTEM ROLE TYPE
	public static final int KEY_SYSTEM_ROLE_TYPE = 1;
	
	public static final Set PTZ_M_COMMANDS=new HashSet();
	public static final Set PTZ_F_COMMANDS=new HashSet();
	public static final Set PTZ_I_COMMANDS=new HashSet();
	public static final Set PTZ_Z_COMMANDS=new HashSet();
	public static final Set PTZ_STOP_COMMANDS=new HashSet();
	static{
		PTZ_M_COMMANDS.add("TU");
		PTZ_M_COMMANDS.add("TD");
		PTZ_M_COMMANDS.add("PL");
		PTZ_M_COMMANDS.add("PR");
		PTZ_M_COMMANDS.add("TUPR");
		PTZ_M_COMMANDS.add("TUPL");
		PTZ_M_COMMANDS.add("TDPR");
		PTZ_M_COMMANDS.add("TDPL");
		
		PTZ_F_COMMANDS.add("FN");
		PTZ_F_COMMANDS.add("FR");
		
		PTZ_I_COMMANDS.add("IO");
		PTZ_I_COMMANDS.add("IC");
		
		PTZ_Z_COMMANDS.add("ZIN");
		PTZ_Z_COMMANDS.add("ZOUT");
		
		PTZ_STOP_COMMANDS.add("IST");
		PTZ_STOP_COMMANDS.add("FST");
		PTZ_STOP_COMMANDS.add("STOP");
	}
	public final static String PTZ_STOP="STOP";
	public final static String PTZ_AUTO_START="AUTO_START";
	public final static String PTZ_AUTO_STOP="AUTO_STOP";
	public final static String USER_TYPE_VAU="1";
	public final static String IGNORE_UPDATE="ignore";
}
